﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SimpleControlLibrary
{
    /// <summary>
    /// ImageButtonControl.xaml 的交互逻辑
    /// </summary>
    public partial class ImageButtonControl
    {
        public ImageButtonControl()
        {
            InitializeComponent();
            this.panel.DataContext = this;
        }

        public static readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source",
                                                                                              typeof(ImageSource),
                                                                                              typeof(ImageButtonControl));

        public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text",
            typeof (string),
                                                                                             typeof (ImageButtonControl));
        public ImageSource Source
        {
            get { return GetValue(SourceProperty) as ImageSource; }
            set { SetValue(SourceProperty, value); }
        }

        public string Text
        {
            get { return GetValue(TextProperty) as string; }
            set { SetValue(TextProperty, value); }

        }

        public static readonly DependencyProperty KeyGestureProperty = DependencyProperty.Register("KeyGesture",
                                                                                                   typeof(KeyGesture),
                                                                                                   typeof (
                                                                                                       ImageButtonControl
                                                                                                       ));

        public KeyGesture KeyGesture
        {
            get { return GetValue(KeyGestureProperty) as KeyGesture; }
            set
            {
                SetValue(KeyGestureProperty, value);
            }
        }
    }
}
